<?php
/**
 * Created by PhpStorm.
 * User: lhl
 * Date: 2020/12/25
 * Time: 10:10
 * Features:学习配置
 */

namespace app\api\controller\netfilter;


use app\api\controller\BaseController;
use app\api\model\HostLearnConfigModel;
use think\Request;

class HostLearnConfigController extends BaseController
{
    /**
     * 将防火墙接管状态更改为已接管
    */
    public function setControlledFirewall(Request $request){
        $param = $request->only([
            'hostkey'
        ],'post');
        $this->validate($param,'HostLearnConfig.setControlledFirewall');
        //将hostkey转换为host_id
        $param['host_id'] = $this->getHostIdByHostKey($param['hostkey']);
        $model = new HostLearnConfigModel();
        $model->setControlledFirewall($param);
        return $this->jsonOutPut();
    }
}